var encoding = require('encoding')
var xdb = require('xdb')

function main() {
  xdb.new('zcx', `/database/zcx`)
  const document = JSON.parse(encoding.from(payload.body))
  // 根据字段条件获取文档
  const fields = {
    name: { contains: document.search },
  }
  return xdb.getDocumentsByFields('zcx', 'role', fields)
}
